home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / miscpas.zip / SPIN.PAS < prev    next >
Pascal/Delphi Source File  |  1984-06-12  |  890b  |  40 lines

  1. Program Spin;
  2.  
  3. {  A simple graphics demonstration using the hires screen.  This program  }
  4. {  uses the external function LINE.INV which must reside on the default   }
  5. {  drive in order to compile the program.   Jeff Firestone  June, 1984.   }
  6.  
  7. Const
  8.   grid = 5;
  9.   oneToFour = 1.50;
  10.   ay = 0;
  11.   bx = 400;
  12.   cy = 199;
  13.   dx = 0;
  14. Var
  15.   ax, by, cx, dy, i : integer;
  16.  
  17. procedure Line(a,b,c,d,e:integer); External 'Line.INV';
  18.  
  19. begin
  20.   ax:= 0;
  21.   by:= 0;
  22.   cx:= bx;
  23.   dy:= cy;
  24.   hires; hiresColor(7);
  25.   for i:= 1 to (bx + cy) div (round(oneToFour * grid)) do
  26.   begin
  27.     Line(ax, ay, bx, by, 1);
  28.     Line(bx, by, cx, cy, 1);
  29.     Line(cx, cy, dx, dy, 1);
  30.     Line(dx, dy, ax, ay, 1);
  31.     ax:= ax + grid;
  32.     by:= by + grid;
  33.     if by > 639 then by:= 639;
  34.     cx:= cx - grid;
  35.     if cx < 0 then cx:= 0;
  36.     dy:= dy - grid;
  37.     if dy < 0 then dy:= 0;
  38.   end;
  39. end.
  40.